GH-48837: [C++] Remove invalid DCHECK when allow_delayed_open is true#48836
GH-48837: [C++] Remove invalid DCHECK when allow_delayed_open is true#48836jiaqizho wants to merge 1 commit intoapache:mainfrom
Conversation
|
Thanks for opening a pull request! If this is not a minor PR. Could you open an issue for this pull request on GitHub? https://github.com/apache/arrow/issues/new/choose Opening GitHub issues ahead of time contributes to the Openness of the Apache Arrow project. Then could you also rename the pull request title in the following format? or See also: |
|
|
|
@lidavidm @westonpace @wgtmac PTAL |
There was a problem hiding this comment.
Pull request overview
Removes an invalid debug assertion in the S3 output stream multipart upload path when allow_delayed_open is enabled (fixing a DEBUG-mode crash when the first write triggers multipart upload creation).
Changes:
- Removed
DCHECK(ShouldBeMultipartUpload())fromObjectOutputStream::CreateMultipartUpload()to avoid an incorrect invariant whenpos_ == 0but a multipart upload is still legitimately created (e.g., large first write).
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
hrishikeshh-shinde
left a comment
There was a problem hiding this comment.
The DCHECK assumes pos_ has already been updated before CreateMultipartUpload() is called, but with allow_delayed_open the first write can trigger a multipart upload while pos_ is still 0. Removing the DCHECK fixes the crash. The MATLAB CI failure looks unrelated to this one-line change.
@hrishikeshh-shinde would u like help to retrigger the CI? thanks |
I think only members can trigger the CI |
Thanks for opening a pull request!
If this is your first pull request you can find detailed information on how to contribute here:
Please remove this line and the above text before creating your pull request.
Rationale for this change
C++ build with DEBUG mode.
Core
In
ShouldBeMultipartUpload(). Thepos_is 0, because nothing written,allow_delayed_open_is true, DCHECK won't be success in this case.What changes are included in this PR?
Remove invalid DCHECK when allow_delayed_open is true
Are these changes tested?
Yes
Are there any user-facing changes?
Nope
This PR includes breaking changes to public APIs. (If there are any breaking changes to public APIs, please explain which changes are breaking. If not, you can remove this.)
This PR contains a "Critical Fix". (If the changes fix either (a) a security vulnerability, (b) a bug that caused incorrect or invalid data to be produced, or (c) a bug that causes a crash (even when the API contract is upheld), please provide explanation. If not, you can remove this.)